<?php defined( "_JEXEC" ) or die( "Restricted access" );

/**
 * @package             Joomla
 * @subpackage          Coala Web Social Links Module
 * @author              Steven Palmer
 * @author url          http://coalaweb.net
 * @author email        support@coalaweb.net
 * @license             GNU/GPL, see /files/en-GB.license.txt
 * @copyright           Copyright (c) 2012 Steven Palmer All rights reserved.
 * @version             Version 0.0.1 June 2012
 *
 * Coala Web Social Links is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

require_once (dirname(__FILE__).DS.'helper.php');

$urlModMedia = JURI::root() . "media/mod_coalawebsociallinks/";
$moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
$doc = JFactory::getDocument();


$link               = JURI::getInstance()->toString();
$title              = $doc->getTitle();

$size               = $params->get('icon_size');
$themesicon         = $params->get('themes_icon');
$load_layout_css    = $params->get('load_layout_css');

$title      = rawurlencode($title);
$link       = rawurlencode($link);

/*Display sections and borders */
$display_b_sec      = $params->get('display_b_sec');
$display_f_sec      = $params->get('display_f_sec');
$display_borders    = $params->get('display_borders');
$borderwidth        = $params->get('border_width');

/*Titles */
$titlebookmark      = $params->get('title_bookmark',JTEXT::_('MOD_COALAWEBSOCIALLINKS_TITLE_BOOKMARK'));
$titlefollow        = $params->get('title_follow',JTEXT::_('MOD_COALAWEBSOCIALLINKS_TITLE_FOLLOW'));

/* Colors */
$titlecolorbookmark     = $params->get('title_color_bookmark');
$titlecolorfollow       = $params->get('title_color_follow');
$bordercolorbookmark    = $params->get('border_color_bookmark');
$bordercolorfollow      = $params->get('border_color_follow');


/* Follow Links */
$linkfacebook       = $params->get('link_facebook');
$linkgoogle         = $params->get('link_google');
$linklinkedin       = $params->get('link_linkedin');
$linktwitter        = $params->get('link_twitter');
$linkrss            = $params->get('link_rss');
$linkmyspace        = $params->get('link_myspace');
$linkvimeo          = $params->get('link_vimeo');
$linkyoutube        = $params->get('link_youtube');
$linkdribbble       = $params->get('link_dribbble');
$linkdeviantart     = $params->get('link_deviantart');
$linkemail          = $params->get('link_email');
$linkebay           = $params->get('link_ebay');
$linktuenti         = $params->get('link_tuenti');
$linkbehance        = $params->get('link_behance');
$linkdesignmoo      = $params->get('link_designmoo');
$linkflickr         = $params->get('link_flickr');

/* Powered by */
$copy 		= $params->get('copy', 1);
$powered 	= $params->get('powered',JTEXT::_('MOD_COALAWEBSOCIALLINKS_POWERED'));


/* Load css */
if($params->get("load_layout_css")) {
    $doc->addStyleSheet($urlModMedia . "css/style.css");
    $cwstyletitle = '<style type="text/css">
                    .cw-social-mod-bookmark h3 {
                        color:'.$titlecolorbookmark.'
                        }
                    .cw-social-mod-follow h3 {
                        color:'.$titlecolorfollow.'
                        }
                 </style>';
    if($params->get("display_borders")) {
        $cwstyleborder = '<style type="text/css">
                        .cw-social-mod-bookmark {
                            border:'.$borderwidth.'px solid '.$bordercolorbookmark.'
                            }
                        .cw-social-mod-follow {
                            border:'.$borderwidth.'px solid '.$bordercolorfollow.'
                            }
                    </style>';}
    ;
}

$doc->addStyleSheet($urlModMedia . "themes-icon/".$themesicon."/style.css");

require JModuleHelper::getLayoutPath('mod_coalawebsociallinks', $params->get('layout', 'default'));

